﻿using NiceComponents.MulPages.Events;
using Stylet;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NiceComponents.MulPages.Pages
{
    public class Page1ViewModel : Screen
    {
        private readonly IEventAggregator _events;

        public Page1ViewModel(IEventAggregator events)
        {
            _events = events;
        }   

        public string Message { get; set; }
        public void SendMessage()
        {
            Debug.WriteLine("SendMessage");
            _events.Publish(new SomeEvent
            {
                Args = new SomeEventArgs
                {
                    Msg = Message
                }
            });
        }
    }
}
